//
//  Api.h
//  SSWiFi
//
//  Created by 酷安 @啥也不会啊啊啊啊啊啊  on 2024/3/10.
//

#import "BaseApi.h"
#import "HomeItemModel.h"
#import "BandItemModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface Api : BaseApi
@property (copy,nonatomic,readonly) NSString *serverHost;
@property (strong,nonatomic) NSDictionary *serverinfo;

- (instancetype)init:(NSDictionary *)serverInfo;


- (NSString *)serverHost:(BOOL)isPost;

/// 登录
/// @param callback callback
- (void)loginCallback:(nullable void (^)(bool flag))callback;

/// 获取首页数据
/// @param callback callback
/// @param errorBack errorBack
- (void)getHomeDataCallback:(nullable void (^)(NSArray<HomeItemModel *> *data))callback errorBack:(nullable void (^)(NSError *err))errorBack;
// 获取京东云频段
- (void)get_Reside_Band;



/// 测速登录
/// @param url 登录ip+path
/// @param pwd  密码
/// @param callback callback
- (void)testLogin:(NSString *)url pwd:(NSString *)pwd callback:(void (^)(bool flag))callback;


/// 重启
/// @param callback callback
- (void)rebootCallback:(nullable void (^)(bool flag,NSString*msg))callback;

/// 关机
/// @param callback callback
- (void)poweroffCallback:(void (^)(bool flag, NSString * _Nonnull msg))callback;

/// WiFi范围
/// @param wifi_coverage WiFi范围值
/// @param callback callback
- (void)setWiFiCoveragePara:(NSString *)wifi_coverage callback:(void (^)(bool))callback;

/// 设置无线
/// @param ssid 无线名称
/// @param pwd 无线密码
/// @param callback callback
- (void)setWiFiInfoWithSsid:(NSString *)ssid pwd:(NSString *)pwd callback:(void (^)(bool))callback;


/// 设置用户流量
/// @param dataNum 用户总流量
/// @param callback callback
- (void)setUserDataNum:(float)dataNum callback:(void (^)(bool))callback;

/// 设置使用流量
/// @param usedata 使用量
/// @param callback callback
- (void)setUsedata:(float)usedata callback:(void (^)(bool flag,NSString*msg))callback;


/// 改串
/// @param imei 新的imei
/// @param callback callback
- (void)setIMEI:(NSString *)imei goformId:(NSString *)goformId callback:(void (^)(NSString *msg))callback;


/// 打开adb
/// @param callback callback
- (void)openAdbCallback:(void (^)(bool flag))callback;


/// 获取支持的频段
/// @param callback callback
- (void)getSupportBandCallBack:(void (^)(NSArray<BandItemModel *> * _Nullable))callback;


/// 设置频段
/// @param bands 频段
/// @param callback callback
- (void)setBandPara:(NSString *)bands callBack:(void (^)(bool, NSString * _Nonnull))callback;


/// 获取当前选择的频段
/// @param callback callback
- (void)getSelectedBandCallBack:(void (^)(NSString * _Nullable bands))callback;
@end

NS_ASSUME_NONNULL_END
